﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Flower.Processing;

namespace Flower.Testing
{
    public class WorkflowTestException : Exception
    {
        public IActivity Activity { get; private set; }

        internal WorkflowTestException(string testName, string reason, IActivity activity, Exception innerException)
            : base
            (
                string.Format
                (
                    "Workflow test '{0}' failed in activity '{1}' at {2}[{3}]: {4}.",
                    testName,
                    activity.Name,
                    activity.Location.StatementType, 
                    activity.Location.StatementIndex,
                    reason
                ), 
                innerException
            )
        {
            Activity = activity;
        }
    }
}
